package com.yangtao.prototype.system.login.service.impl;

import com.yangtao.framework.service.BaseService;
import com.yangtao.prototype.system.login.service.UserDataCalculator;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @author: 杨涛
 * @version: 1.0
 * @date: 11-7-16 下午11:03
 */
@Service
@Scope("prototype")
public class UserDataCalculatorImpl extends BaseService implements UserDataCalculator {
	/**
	 * 用户Id
	 */
	private String userId;

	/**
	 * 设置用户Id
	 *
	 * @param userId
	 */
	@Override
	public void setUserId(String userId) {
		this.userId = userId;
	}

	/**
	 * 获取用户的页面权限数据
	 *
	 * @return
	 */
	@Override
	public Map<String, String> getPageElementAuthority() {
		return null;
	}

	/**
	 * 获取用户的仓库权限
	 *
	 * @return
	 */
	@Override
	public Map<String, String> getWarehouseAuthority() {
		return null;
	}

	/**
	 * 获取用户的客户权限
	 *
	 * @return
	 */
	@Override
	public Map<String, String> getCustomerAuthority() {
		return null;
	}

	/**
	 * When an object implementing interface <code>Runnable</code> is used
	 * to create a thread, starting the thread causes the object's
	 * <code>run</code> method to be called in that separately executing
	 * thread.
	 * <p/>
	 * The general contract of the method <code>run</code> is that it may
	 * take any action whatsoever.
	 *
	 * @see Thread#run()
	 */
	@Override
	public void run() {
		try {
			Thread.sleep(1000);
			System.out.println(Thread.currentThread().getName() + "========");
		} catch (InterruptedException e) {
			e.printStackTrace();
		}

	}
}
